﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="attachment.aspx.cs" Inherits="Mocola.Net.Web.attachment" %>

<!-- BEGIN: [#15] -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>CsLand Ams v1.0 - 中新置地档案管理系统</title>
    <link rel="stylesheet" href="css/content.css" type="text/css" />
    <link rel="stylesheet" href="css/ui.css" type="text/css" />
    <link rel="stylesheet" href="css/sys.css" type="text/css" />
    <link rel="stylesheet" href="css/dtree.css" type="text/css" />

    <script type="text/javascript" src="scripts/mootools-1.2-core.js"></script>
    <script type="text/javascript" src="scripts/mootools-1.2-more.js"></script>
    <script type="text/javascript" src="scripts/mocha.js"></script>
    <script type="text/javascript" src="scripts/mocola-funs.js"></script>
    <style type="text/css">
        td, tr, table
        {
            font-size: 12px;
        }
    </style>
    
</head>
<body>

    <script type="text/javascript">
       function chooseAll(obj)
	    {
		    var chks=$("<%=listAttachment.ClientID%>").getElementsByTagName("input");	  
		    for(var i=0;i<chks.length;i++)
		    {
		        chks[i].checked=obj.checked;
		    }
	    }
	    function ConfirmDelete()
	    {
	        var chks=$("<%=listAttachment.ClientID%>").getElementsByTagName("input");	
	        var c=0;  
		    for(var i=0;i<chks.length;i++)
		    {
		        if(chks[i].checked) c++;
		    }
		    if(c==0)
		    {
		        alert("请先选择附件后再删除");
		        return false;
		    }
		    else
		       return confirm("确定删除选择的附件吗");
	    }
	    function OpenAttachment(file)
	    {
	        window.open(file,"查看附件",'');
	    }
	    function Chk()
        {
            var v=$("<%=upLoad.ClientID%>").value;
            if(v.length<1)
            {
                alert("请选择附件");
                return false;
            }         
        }
    </script>

    <form id="form1" runat="server">
    <div class="dvspec" style="margin-top: 5px;">
        <div style="padding: 10px;">
            <div class="title1">
                附件列表：
            </div>
            <div style="padding-left: 10px; border-bottom: 1px solid #c8c8c8; padding-bottom: 5px;
                margin-bottom: 5px;">
                <asp:LinkButton ID="btnDel" runat="server" OnClientClick="return ConfirmDelete();"
                    OnClick="btnDel_Click">删除附件</asp:LinkButton>
            </div>
            <div>
                <asp:DataList ID="listAttachment" Width="90%" runat="server" OnItemDataBound="listAttachment_ItemDataBound">
                    <HeaderTemplate>
                        <div style="width: 30px; float: left;">
                            <asp:CheckBox ID="chkall" onclick="chooseAll(this);" runat="server" />
                        </div>
                        <div style="float: left; width: 200px;">
                            附件名称
                        </div>
                        <div style="float: left; width: 200px;">
                            附件描述
                        </div>
                        <div>
                            查看附件
                        </div>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <div style="width: 30px; float: left;">
                            <asp:CheckBox ID="chkItem" runat="server" />
                        </div>
                        <div style="float: left; width: 200px;">
                            <%# Eval("AttachmentName")%>
                        </div>
                        <div style="float: left; width: 200px;">
                            <%# Eval("Description")%>
                        </div>
                        <div>
                            <asp:LinkButton ID="btnView" runat="server">查看附件</asp:LinkButton>
                        </div>
                    </ItemTemplate>
                </asp:DataList>
            </div>
        </div>
        <div style="padding: 10px;">
            <ul style="list-style: none; line-height:40px;">
                <li>
                    <asp:Label ID="Label1" runat="server" Text="选择附件："></asp:Label>
                    <asp:FileUpload ID="upLoad" runat="server" Style="width: 300px;" CssClass="btnzc" />
                </li>
                <li>
                    <asp:Label ID="Label2" runat="server" Text="附件描述："></asp:Label>
                    <asp:TextBox ID="txtDescrition" Cssclass="inputbox" Style="width: 300px;" runat="server"></asp:TextBox>
                </li>
                <li style="text-align: center;">
                    <asp:Button ID="btnUploadFile" runat="server" Text="上传" CssClass="btnzc" OnClientClick="return Chk();" OnClick="btnUploadFile_Click" />
                </li>
            </ul>
        </div>
    </div>
    </form>
</body>
</html>
<!-- BEGIN: [#15] -->
